import request from '@/utils/request'

// 查询客户列表
export function getCustomerNameList(query) {
	return request({
		url: '/tms/saleOrder/seletCustomerNameList',
		method: 'get',
		params: query
	})
}

// 查询客户列表
export function getNameListByName(customerName) {
	return request({
		url: '/tms/saleOrder/seletNameListByName/' + customerName,
		method: 'get'

	})
}

// sap订单同步
export function orderSynchronization(query) {
	return request({
		url: '/tms/ec/orderSynchronization',
		method: 'post',
		timeout: 120000,
		data: query
	})
}

// sap订单同步
export function orderSyncByOptName(query) {
  return request({
    url: '/tms/ec/orderSyncByOptName',
    method: 'post',
    timeout: 240000000 ,
    data: query
  })
}

// 查询销售订单表列表
export function listSaleOrder(query) {
	return request({
		url: '/tms/saleOrder/list',
		method: 'get',
		params: query
	})
}

// 查询销售订单表列表
export function uniListSaleOrder(query) {
	return request({
		url: '/tms/saleOrder/uniList',
		method: 'get',
		params: query
	})
}

// 查询销售订单表详细
export function getSaleOrderPage(vbeln) {
	return request({
		url: '/tms/ec/getSaleOrderPage/' + vbeln,
		method: 'get'
	})
}

// 新增发货申请订单表
export function saveDeliverOrder(data) {
	return request({
		url: '/sales/saleOrder/applySaleOrder',
		method: 'post',
		data: data
	})
}

// 运费计算
export function calculateExpectedCost(data) {
	return request({
		url: '/tms/ec/calculateExpectedCost',
		method: 'post',
		data: data
	})
}

export function selectEcDeliverVehicleList(data) {
	return request({
		url: '/tms/ecDeliverVehicle/list',
		method: 'post',
		data: data
	})
}

export function selectEcOneDeliverVehicleList(data) {
	return request({
		url: '/tms/oneVehicle/list',
		method: 'post',
		data: data
	})
}

export function getSaleOrderDetailPage(query) {
	return request({
		url: '/tms/ec/getSaleOrderDetailPage',
		method: 'post',
		timeout: 600000,
		data: query
	})
}

// 查询包重
export function getApplyWeight(data) {
	return request({
		url: '/tms/ec/getApplyWeight',
		data: data,
		method: 'post'
	})
}

// 查询客户地址管理列表
export function listAddressCustName(query) {
  return request({
    url: '/tms/address/listCustName',
    method: 'get',
    params: query
  })
}

// 查询客户地址管理列表
export function listAddress(query) {
  return request({
    url: '/tms/address/list',
    method: 'get',
    params: query
  })
}

export function statusSyncByOptName() {
  return request({
    url: '/tms/ec/statusSyncByOptName',
    method: 'post',
    timeout: 240000 ,
  })
}

// 物流运费折扣查询
export function querySAPRebate(data) {
  return request({
    url: '/external/sap/querySAPRebate',
    method: 'post',
    data: data
  })
}

// 查询客户详细信息表列表
export function listDeliCust(query) {
  return request({
    url: '/iou/deliCust/list',
    method: 'get',
    params: query
  })
}